/*预先加载layui模块*/
layui.config({
    base: '/js/ext/' // 设定扩展的 layui 模块的所在目录，一般用于外部模块扩展
}).use(['form', 'laydate', 'table', 'util', 'serverurl'], function(){
    const form = layui.form,
        laydate = layui.laydate,
        table = layui.table,
        util = layui.util,
        auth = layui.auth;
    /*-----------table-----------*/
    table.render({
        elem: '#LAY-user-table',
        url: auth.user.list,
        method: 'post',
        contentType: 'application/json',
        page: true,
        autoSort: false,
        cols: [ [
            {field: 'id', title: 'ID'},
            {field: 'status', title: '状态', sort: true},
            {field: 'userName', title: '用户名'},
            {field: 'password', title: '密码'},
            {field: 'sexDesc', title: '性别'},
            {field: 'idCard', title: '身份证号'},
            {field: 'phone', title: '手机号'},
            {field: 'createTime', title: '创建时间',  sort: true, templet: function(d){return util.toDateString(d.createTime, "yyyy-MM-dd HH:mm:ss")}},
            {width: 150, align: 'center', title: '操作', toolbar: '.LAY-tool-bar'}
        ]],
        parseData: function (res) {
            return {
                "code": res.code,
                "msg": res.message,
                "count": res.data.total,
                "data": res.data.records
            };
        },
        request: {
            pageName: 'current',
            limitName: 'size',
            whereName: 'query'
        }
    });

    /*-----------form-----------*/
    /*-----------laydate-----------*/
    /*-----------util-----------*/

});




/*预先加载css*/
layui.link('../../css/layui.css');

